from orion.modules.OpenSubtitle import OpenSubtitle
from orion.util.FileUtil import FileUtil
import unittest

class OpenSubtitleTest(unittest.TestCase):
    
    __MOCK_FILES = ["E:\\Development\\Projects\\Python\\Orion\\test\\resources\\breakdance.avi"]
    
    def setUp(self):
        self.ops = OpenSubtitle()

    def testSearch(self):
        self.ops.search(self.__MOCK_FILES)
        path, title = FileUtil.info(self.__MOCK_FILES[0])
        expected = {"1951904083" : {"Destination" : path, "Name" : title}}
        self.assertEqual(expected, self.ops.subtitles)
        
    def testDownload(self):
        self.ops.search(self.__MOCK_FILES)
        self.ops.download()
        self.assertFalse(True, "mock")
                    
    def tearDown(self):
        self.ops.close()

if __name__ == "__main__":
    unittest.main()